package com.lachesis.molecule.common.dbquery;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

@ApiModel(value="PageQueryArgs", description="用于分页查询时传递查询条件，如要查询第10000~10100，offset=10000，num=101")
public class PageQueryArgs {

	public PageQueryArgs()
	{
		this(0, 100);
	}
	
	public PageQueryArgs(int offset, int num)
	{
		this(offset, num, false);
	}
	
	public PageQueryArgs(int offset, int num, boolean countAll)
	{
		this.setOffset(offset);
		this.setNum(num);
		this.setCountAll(countAll);
	}
	
	@ApiModelProperty(name="num", value="查询的数据量")
	private int num;
	
	@ApiModelProperty(name="offset", value="查询的偏移位置")
	private int offset;	
	
	@ApiModelProperty(name="paged", value="查询时是否统计数据总量，会降低执行效率")
	private boolean countAll;
	
	@ApiModelProperty(name="orderBy", value="查询时的排序规则")
	private String orderBy;
	
	public int getNum() {
		return num;
	}
	public void setNum(int num) {
		this.num = num;
	}
	public int getOffset() {
		return offset;
	}
	public void setOffset(int offset) {
		this.offset = offset;
	}

	
	public boolean isCountAll() {
		return countAll;
	}

	public void setCountAll(boolean counstAll) {
		this.countAll = counstAll;
	}

	public String getOrderBy() {
		return orderBy;
	}

	public void setOrderBy(String orderBy) {
		this.orderBy = orderBy;
	}
}
